#ifndef __SKINNEDMESH_H__
#define __SKINNEDMESH_H__

#include <dalelib/graphics.h>
#include <dalelib/graphics/mesh.h>
#include <dalelib/graphics/skeleton.h>
#include <dalelib/graveyard/agent.h>

namespace dalelib
{

class SkinnedMesh
	: public Mesh
{
private:

	vector<v4> _bone_index_array;
	vector<v4> _bone_weight_array;
	Skeleton *_skeleton;
	Agent* _agent;

public:

	vector<v4>& getBoneIndexArray() { return _bone_index_array; }
	vector<v4>& getBoneWeightArray() { return _bone_weight_array; }

	float distanceToLineSegment(v3 &_Start, v3 &_End, v3 &_Point);
	void createWeights(const int _BlurPasses=0);
	void loadWeights(const string _Path);
	void init(Skeleton *_Skeleton);
	void init(Agent *_Agent);
	void draw();

};

} // namespace dalelib

#endif
